package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@RequestMapping("/user")
@Controller
@ResponseBody
public class UserController {

    private static final Logger logger= LoggerFactory.getLogger(UserController.class);

    @RequestMapping("/hi")
    public String sayHi(){
        //打印日志
        logger.trace("我是trace");
        logger.debug("我是debug");
        logger.info("我是info");//默认级别info，只能打印更高级别的 
        logger.warn("我是warn");
        logger.error("我是error");
        return "hi,spring Boot.";
    }
}
